import request from "@/utils/request"
import { ReqFindSupermarketItem, reqAddSupermarketParams, reqFindSupermarketParams } from "@/views/supermarket/types"

// 查看所有商超
export function reqFindSupermarket(params: Partial<reqFindSupermarketParams>) {
    return request<ReqFindSupermarketItem[]>({
        url: '/findSupermarket',
        method: 'post',
        data: params,
    })
}
// 添加留言板
export function reqAddMessage(params: any) {
    return request({
        url: '/addMessage',
        method: 'post',
        data: params,
    })
}
// 只看我的留言板
export function reqFindMyMessage(params: any) {
    return request({
        url: '/findMyMessage',
        method: 'post',
        data: params,
    })
}
// 查看全部留言板信息
export function reqFindMessageAndComplain(params: any) {
    return request({
        url: '/findMessage',
        method: 'post',
        data: params,
    })
}
// 添加商超
export function reqaddSupermarket(params: Partial<reqAddSupermarketParams>) {
    return request({
        url: '/addSupermarket',
        method: 'post',
        data: params,
    })
}
// 通过id查询
export function reqfindSupermarketById(params: { id: string }) {
    return request({
        url: '/findSupermarketById',
        method: 'post',
        data: params,
    })
}
// 修改商超
export function reqModifySupermarket(params: Partial<reqAddSupermarketParams>) {
    return request({
        url: '/modifySupermarket',
        method: 'post',
        data: params,
    })
}
// 删除商超
export function reqRemoveSupermarket(params: { id: string }) {
    return request({
        url: '/removeSupermarket',
        method: 'post',
        data: params,
    })
}
// 删除留言
export function reqRemoveMessage(params: { id: string }) {
    return request({
        url: '/removeMessage',
        method: 'post',
        data: params,
    })
}